home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cgraphix
/
cfndwrld.c
< prev
next >
Wrap
Text File
|
1986-05-28
|
1KB
|
66 lines
/* «RM120»«PL99999»«TS4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76» */
#include <stdio.h>
#define EXTERN extern
#include <typedef.h>
void FindWorldDem()
{
extern double random();
double x;
int dx,dy,i,n,lines,scale;
int X1,Y1,X2,Y2;
PlotArray b, a;
DefineWindow(1,0,0,XMaxGlb,YMaxGlb);
DefineWindow(2,0,0,XMaxGlb,YMaxGlb);
DefineWorld(1, 0., 0., 1000., 1000.);
DefineHeader(2,"A FOUND WORLD");
SelectWindow(2);
SetHeaderOn();
n = 10;
for (i = 0; i < n;i++) {
a[2 * i] = i;
a[2 * i + 1] = random()-0.5;
}
FindWorld(2,a,n,1.,1.08);
SelectWindow(2);
DrawBorder();
dx = -8;
dy = 7;
X1 = 3;
Y1 = 5;
X2 = 25;
Y2 = 10;
lines = 0;
scale = 0;
SetLineStyle(0);
DrawAxis(dx,dy,X1,Y1,X2,Y2,lines,scale,FALSE);
DrawPolygon(a,1,n,7,2,0);
SelectWorld(1);
SelectWindow(1);
DrawTextW((double)730,(double)450,1,"\0337@2 The data");
DrawTextW((double)730,(double)550,1,"-- The curve");
}
main()
{
InitGraphic();
FindWorldDem();
inkey();
LeaveGraphic();
}